package com.sky.config;

import com.jfinal.config.*;

import com.jfinal.render.ViewType;
import com.jfinal.template.Engine;
import com.sky.intercepter.NotNullParaInterceptor;
import com.sky.intercepter.ProjectInterceptor;

/*
 *用户：sky-吴
 *日期：2020/4/24
 * 没有生效
 */
public class ApplicationConfig extends JFinalConfig {
	@Override
	public void configConstant(Constants me) {
		me.setViewType(ViewType.JFINAL_TEMPLATE);
	}

	@Override
	public void configRoute(Routes me) {

	}

	@Override
	public void configEngine(Engine me) {

	}

	@Override
	public void configPlugin(Plugins me) {

	}

	@Override
	public void configInterceptor(Interceptors me) {
		ProjectInterceptor projectInterceptor = new ProjectInterceptor();
		me.add(projectInterceptor);
		me.add(new NotNullParaInterceptor(null));
	}

	@Override
	public void configHandler(Handlers me) {

	}

	@Override
	public void onStart() {

		System.out.println("系统启动中, 数据正在加载....");


		super.onStart();
	}

	@Override
	public void onStop() {
		System.out.println("系统正在关闭, 数据正在保存......");
		super.onStop();
	}
}
